package cn.tx.user.feign.client;

import cn.tx.user.feign.fallback.UserClientFallBack;
import cn.tx.pojo.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 订单客户端feign接口
 * @author: zealon
 * @since: 2019/7/4
 */

@FeignClient(value = "user-server", fallbackFactory = UserClientFallBack.class)
//@FeignClient(contextId = "user", name = "user-server", fallbackFactory = UserClientFallBack.class)
public interface UserClient {

    @GetMapping("/user/getUserById/{id}")
    User getUserById(@PathVariable("id") Long id);

    @GetMapping("/user/getListUser")
    List<User> getListUser(@RequestParam Map<String, Object> params);

}